import json

from django.http import HttpResponse
from django.shortcuts import render

from entity.common.response import ResponseData, ResponseStatus
from searchApp.service.searchService import SearchService
from utils.transfer import transferToJson

searchService =  SearchService()

def searchController(request):
    keyword = request.GET['keyword']
    page = request.GET['page']
    size = request.GET['size']
    result = searchService.search(keyword,page,size)
    request.session['keyword'] = keyword
    return render(request=request,
                  template_name="goods.html",
                  context=result)
# {'goodsList':goodsList,'total_page':total_pages}
